package com.pxene.hbasecount;

import java.io.IOException;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

public class HBaseCountReducer extends Reducer<Text, LongWritable, Text, LongWritable> {
	private LongWritable resultVal = new LongWritable(1);
	@Override
	protected void reduce(Text key, Iterable<LongWritable> values, Reducer<Text, LongWritable, Text, LongWritable>.Context context) throws IOException, InterruptedException {
		long sum=0;
		for (LongWritable each : values) {
			sum+=each.get();	
		}
		resultVal.set(sum);
		context.write(key, resultVal);
	}
}
